# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=windows-exploit-suggester
pkgver=41.776bd91
pkgrel=4
pkgdesc='This tool compares a targets patch levels against the Microsoft vulnerability database in order to detect potential missing patches on the target.'
groups=('blackarch' 'blackarch-recon')
arch=('any')
url='https://github.com/GDSSecurity/Windows-Exploit-Suggester'
license=('GPL3')
depends=('python2' 'python2-xlrd')
makedepends=('git')
source=("$pkgname::git+https://github.com/GDSSecurity/Windows-Exploit-Suggester.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|/bin/env python|/bin/env python2|' "$pkgname.py"
}

package() {
  cd $pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

